import request from "../utils/request";

/***
 * @description 登录接口 (注：作废以后可能会用到)
 * @param params
 * @returns {AxiosPromise}
 */
export function api__login(params) {
  return request({
    url: "/user/bind",
    method: "post",
    params
  });
}

/****
 * @description 登录接口 （最新） 请求参数多加了一个appid
 * @param params
 * @return {AxiosPromise}
 */
export function api__login_v2(params) {
  return request({
    url: "/user/login",
    method: "post",
    params
  });
}

/***
 * @description 列表接口
 * @param params
 * @returns {AxiosPromise}
 */
export function api__getList(params) {
  return request({
    url: "/case/main",
    method: "get",
    params
  });
}

/**
 * @description 详情接口
 * @param id
 * @return {AxiosPromise}
 */
export function api__getInfo(id) {
  return request({
    url: `/case/detail/${id}`,
    method: "get",
    params: {}
  });
}

export function api__changeCurrency(params) {
  return request({
    url: `/update/supplier/case/currency`,
    method: "post",
    params
  });
}

/**
 * @description 出价明细接口
 * @param params
 * @return {AxiosPromise}
 */
export function api__endBiddingInfo(params) {
  return request({
    url: "/offer/list/get",
    method: "get",
    params
  });
}

/****
 * @description 获取用户信息
 * @param params
 * @return {AxiosPromise}
 */
export function api__getUserInfo() {
  return request({
    url: "/user/info",
    method: "get",
    params: {}
  });
}

/***
 * @description 退出
 * @param params
 * @return {AxiosPromise}
 */
export function api__logout() {
  return request({
    url: "/user/logout",
    method: "post",
    params: {}
  });
}

/***
 * @description 解绑
 * @param params
 * @return {AxiosPromise}
 */
export function api__untieAndLogout() {
  return request({
    url: "/user/unbind",
    method: "post",
    params: {}
  });
}
